﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using QLKS.Templates;
//using DevExpress.XtraReports.UI;
using System.Data;
//using QLKS.Report;
//using DevExpress.XtraReports.UserDesigner;
//using DevExpress.LookAndFeel;
using System.Windows.Forms;
//using DevExpress.XtraReports.UI;
//using DevExpress.XtraReports.UserDesigner;

namespace QLKS.Views
{
    /// <summary>
    /// Interaction logic for frmPrinter.xaml
    /// </summary>
    public partial class frmPrinter : FormTrans
    {
        string filename = string.Empty;
        DataSet ds = new DataSet();
        public frmPrinter()
        {
            InitializeComponent();
        }

        public frmPrinter(string _filename,DataSet _ds)
        {
            InitializeComponent();
            filename = _filename;
            ds = _ds;
        }

        private void btnView_Click(object sender, RoutedEventArgs e)
        {
            //string fn = string.Empty;
            //if ((bool)rbtVND.IsChecked)
            //    fn = "VN.repx";
            //else
            //    fn = "NT.repx";
            //string repXFile = System.Windows.Forms.Application.StartupPath + "\\Report\\" + filename + fn;

            //XtraReport result = new XtraReport();
            //result.LoadLayout(repXFile);
            //result.DataSource = ds;
            //result.ShowRibbonPreview();
            //this.Close();
        }

        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            //string fn = string.Empty;
            //if ((bool)rbtVND.IsChecked)
            //    fn = "VN.repx";
            //else
            //    fn = "NT.repx";
            //string repXFile = System.Windows.Forms.Application.StartupPath + "\\Report\\" + filename + fn;

            ////showreport(false);
            //XtraReport report = new XtraReport();
            //report.PaperName = "jjjjj";
            ////BCDoanhThuTheoLoaiPhong report = new BCDoanhThuTheoLoaiPhong();
            //if (System.IO.File.Exists(repXFile))
            //    report.LoadLayout(repXFile);
            //else
            //    if (System.Windows.MessageBox.Show(M_LAN.Equals("V") ? "Mẫu báo cáo không tồn tại có muốn tạo mói không?" : "Report not found. You want create new report file?", "QLKS", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            //        return;
            //report.DataSource = ds;
            ////report.DisplayName = filename + fn;
            //report.SaveLayout(repXFile);
            //report.ShowDesigner();//UserLookAndFeel.Default, DesignDockPanelType.FieldList | DesignDockPanelType.PropertyGrid);
        }

    }
}
